package br.com.bringme.views;

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JRadioButton;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import org.eclipse.wb.swing.FocusTraversalOnArray;
import java.awt.Component;
import java.awt.SystemColor;

@SuppressWarnings("serial")
public class CadastrarCliente extends JFrame {

	private JPanel contentPane;
	private JTextField tfCpf;
	private JTextField tfNome;
	private JTextField tfEndereco;
	private JTextField tfPontoReferencia;
	private JTextField tfTelefone;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CadastrarCliente frame = new CadastrarCliente();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CadastrarCliente() {
		setResizable(false);
		setTitle("BringMe - Cadastrar Cliente");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 470, 230);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JRadioButton rdbtnPessoaFisica = new JRadioButton("F\u00EDsica");
		rdbtnPessoaFisica.setSelected(true);
		rdbtnPessoaFisica.setFont(new Font("Century Gothic", Font.PLAIN, 14));
		rdbtnPessoaFisica.setBounds(188, 7, 70, 23);
		contentPane.add(rdbtnPessoaFisica);
		
		JRadioButton rdbtnPessoaJurdica = new JRadioButton("Jur\u00EDdica");
		rdbtnPessoaJurdica.setFont(new Font("Century Gothic", Font.PLAIN, 14));
		rdbtnPessoaJurdica.setBounds(331, 7, 109, 23);
		contentPane.add(rdbtnPessoaJurdica);
		
		JLabel lblTipoDeCliente = new JLabel("Tipo de Cliente:");
		lblTipoDeCliente.setFont(new Font("Century Gothic", Font.PLAIN, 14));
		lblTipoDeCliente.setBounds(20, 11, 109, 14);
		contentPane.add(lblTipoDeCliente);
		
		JSeparator separator = new JSeparator();
		separator.setForeground(SystemColor.controlShadow);
		separator.setBounds(10, 30, 444, 2);
		contentPane.add(separator);
		
		JLabel lblCpf = new JLabel("CPF:");
		lblCpf.setFont(new Font("Century Gothic", Font.PLAIN, 12));
		lblCpf.setBounds(20, 43, 46, 14);
		contentPane.add(lblCpf);
		
		JLabel lblNome = new JLabel("Nome:");
		lblNome.setFont(new Font("Century Gothic", Font.PLAIN, 12));
		lblNome.setBounds(20, 68, 46, 14);
		contentPane.add(lblNome);
		
		JLabel lblEndereo = new JLabel("Endere\u00E7o:");
		lblEndereo.setFont(new Font("Century Gothic", Font.PLAIN, 12));
		lblEndereo.setBounds(20, 93, 60, 14);
		contentPane.add(lblEndereo);
		
		JLabel lblPontoDeReferencia = new JLabel("Refer\u00EAncia:");
		lblPontoDeReferencia.setFont(new Font("Century Gothic", Font.PLAIN, 12));
		lblPontoDeReferencia.setBounds(20, 118, 75, 14);
		contentPane.add(lblPontoDeReferencia);
		
		JLabel lblTelefone = new JLabel("Telefone:");
		lblTelefone.setFont(new Font("Century Gothic", Font.PLAIN, 12));
		lblTelefone.setBounds(20, 143, 60, 14);
		contentPane.add(lblTelefone);
		
		tfCpf = new JTextField();
		tfCpf.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		tfCpf.setBounds(100, 37, 158, 20);
		contentPane.add(tfCpf);
		tfCpf.setColumns(10);
		
		tfNome = new JTextField();
		tfNome.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		tfNome.setBounds(100, 62, 340, 20);
		contentPane.add(tfNome);
		tfNome.setColumns(10);
		
		tfEndereco = new JTextField();
		tfEndereco.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		tfEndereco.setBounds(100, 87, 340, 20);
		contentPane.add(tfEndereco);
		tfEndereco.setColumns(10);
		
		tfPontoReferencia = new JTextField();
		tfPontoReferencia.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		tfPontoReferencia.setBounds(100, 112, 340, 20);
		contentPane.add(tfPontoReferencia);
		tfPontoReferencia.setColumns(10);
		
		tfTelefone = new JTextField();
		tfTelefone.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		tfTelefone.setBounds(100, 137, 340, 20);
		contentPane.add(tfTelefone);
		tfTelefone.setColumns(10);
		
		JButton btnCadastrar = new JButton("Cadastrar");
		btnCadastrar.setIcon(new ImageIcon(CadastrarCliente.class.getResource("/br/com/bringme/vision/icons/Add_user16.png")));
		btnCadastrar.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		btnCadastrar.setBounds(331, 168, 109, 23);
		contentPane.add(btnCadastrar);
		
		JButton btnCancelar = new JButton("Cancelar");
		btnCancelar.setIcon(new ImageIcon(CadastrarCliente.class.getResource("/br/com/bringme/vision/icons/Cancel16.png")));
		btnCancelar.setFont(new Font("Century Gothic", Font.PLAIN, 11));
		btnCancelar.setBounds(212, 168, 109, 23);
		contentPane.add(btnCancelar);
		setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{tfCpf, tfNome, tfEndereco, tfPontoReferencia, tfTelefone, btnCadastrar, btnCancelar}));
	}
}
